package demo1;

public class Test {
    public static void main(String[] args) {
        Fruit apple = new Apple("苹果");
        Fruit banana = new Banana("香蕉");
        apple.eat();
        banana.eat();
        if(apple instanceof Apple){
            Apple apple1 = (Apple) apple;
            apple1.peel();
        }
    }
}
